package com.chao.cloudconsumerpayment8002.service;

import com.chao.entities.CommonResult;
import com.chao.entities.Payment;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author Administrator
 * @date 2021-06-08 16:08
 */
@Component
@FeignClient(value = "CLOUD-PROVIDER-PAYMENT8001",fallback = HystrixPaymentServiceImpl.class)
public interface PaymentService {

    @PostMapping(value = "/payment/creat")
    public CommonResult creatPayment(@RequestBody Payment payment);

    @GetMapping(value = "/payment/get/{id}")
    public CommonResult getPayment(@PathVariable("id") Long id);
}
